<template>
  <div>
    <!-- 头部 -->
    <div class="head">
      <!-- 上面 -->
      <div class="h-top">
        <van-icon name="setting-o" color="#fff" size="20" />
        <van-icon name="chat-o" color="#fff" size="20" />
      </div>
      <!-- 中间 -->
      <div class="h-center">
        <div class="h-ce-left">
          <div class="img"></div>
          <div class="h-ce-l-right">
            <p>JSBCJBIJSB55</p>
            <span>注册会员</span>
          </div>
        </div>
        <div class="h-ce-right">
          <van-icon name="qr-invalid" color="#fff" size="60" />
          <p>会员专属码</p>
        </div>
      </div>
      <!-- 底部 -->
      <div class="h-bottom">
        <div class="h-b-con">
          <p>0</p>
          <span>收藏商品</span>
        </div>
        <div class="h-b-con">
          <p>0</p>
          <span>关注店铺</span>
        </div>
        <div class="h-b-con">
          <p>0</p>
          <span>足迹</span>
        </div>
        <div class="h-b-con">
          <p>0</p>
          <span>我的评价</span>
        </div>
      </div>
    </div>

    <!-- 中间 -->
    <div class="main">
      <!-- 我的资产 -->
      <div class="m-con">
        <div class="title">我的资产</div>
        <div class="m-c-center">
          <!-- 余额 -->
          <div class="money">
            <div class="m-c-ce-con">
              <p>0</p>
              <span>余额</span>
            </div>
            <div class="m-c-ce-con">
              <p>0</p>
              <span>红包</span>
            </div>
            <div class="m-c-ce-con">
              <p>0</p>
              <span>积分</span>
            </div>
            <div class="m-c-ce-con">
              <p>
                <van-icon name="qr-invalid" color="#f66" size="20" />
              </p>
              <span>付款</span>
            </div>
          </div>
          <!-- 权益 -->
          <div class="equity">
            <div class="eq-con">
              <van-icon name="hot-o" size="40" />
              <p>我的权益</p>
            </div>
            <div class="eq-con">
              <van-icon name="coupon-o" size="40" />
              <p>提货券</p>
            </div>
          </div>
        </div>
      </div>

      <!-- 我的订单 -->
      <div class="m-con">
        <div class="title">
          <van-cell title="我的订单" is-link value="查看全部订单" />
        </div>
        <div class="m-c-center">
          <!-- 余额 -->
          <div class="money">
            <div class="m-c-ce-con">
              <p>
                <van-icon name="pending-payment" color="#000" size="20" />
              </p>
              <span>代付款</span>
            </div>
            <div class="m-c-ce-con">
              <p>
                <van-icon name="send-gift-o" color="#000" size="20" />
              </p>
              <span>待发货</span>
            </div>
            <div class="m-c-ce-con">
              <p>
                <van-icon name="logistics" color="#000" size="20" />
              </p>
              <span>待收货</span>
            </div>
            <div class="m-c-ce-con">
              <p>
                <van-icon name="comment-o" color="#000" size="20" />
              </p>
              <span>待评价</span>
            </div>
            <div class="m-c-ce-con">
              <p>
                <van-icon name="gold-coin-o" color="#000" size="20" />
              </p>
              <span>退款/售后</span>
            </div>
          </div>
        </div>
      </div>

      <!-- 我的工具箱 -->
      <div class="m-con">
        <div class="title">我的工具箱</div>
        <van-grid :column-num="4" :border="false">
          <van-grid-item icon="service" text="我的客服" color="#f66" />
          <van-grid-item icon="friends" text="我的拼团" />
          <van-grid-item icon="balance-list" text="我的砍价" />
          <van-grid-item icon="graphic" text="申请分销商" />
          <van-grid-item icon="lock" text="我的推广" />
          <van-grid-item icon="youzan-shield" text="我的推荐" />
          <van-grid-item icon="gift-card" text="我的提货人" />
          <van-grid-item icon="card" text="我的卡包" />
        </van-grid>
      </div>

      <!-- 退出登录 -->
      <div class="m-con" @click="exit">
        <p class="exit">退出登录</p>
      </div>

    </div>
    <my-tabbar></my-tabbar>
  </div>
</template>

<script>
import MyTabbar from '@components/MyTabbar'
import { getRecommends } from '@api'

export default {
  data () {
    return {
      lives: []
    }
  },
  components: {
    MyTabbar
  },
  created () {
    this.setRecommends()
  },
  methods: {
    // 猜你喜欢
    setRecommends () {
      getRecommends().then(res => {
        this.isLoading = false
        // console.log(res);
        if (res.data.code === 0) {
          if (this.isFirst) {
            Toast('刷新完成了')
          }
          this.lives = res.data.data
        }
      })
    },
    exit () {
      localStorage.removeItem('access_token')
      this.$router.push('/login')
    }
  },

}
</script>

<style lang="scss" scoped>
.head {
  width: 100%;
  height: 200px;
  background-color: #f66;
  padding: 10px;
  .h-top {
    display: flex;
    justify-content: flex-end;
    .van-icon {
      margin-left: 10px;
    }
  }
  .h-center {
    height: 60px;
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    .h-ce-left {
      width: 200px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .img {
        width: 60px;
        height: 60px;
        border-radius: 30px;
        background-color: cyan;
      }
      .h-ce-l-right {
        color: #fff;
        p {
          font-size: 16px;
          font-weight: 550;
          margin-bottom: 5px;
        }
        span {
          display: inline-block;
          width: 60px;
          height: 20px;
          text-align: center;
          line-height: 20px;
          border-radius: 10px;
          font-size: 12px;
          background-color: rgba(0, 0, 0, 0.2);
        }
      }
    }
    .h-ce-right {
      width: 100px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      p {
        color: #fff;
      }
    }
  }
  .h-bottom {
    width: 100%;
    height: 60px;
    display: flex;
    .h-b-con {
      width: 25%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: #fff;
      font-size: 14px;
      p {
        margin-bottom: 10px;
      }
    }
  }
}

.main {
  width: 100%;
  padding: 10px;
  padding-bottom: 50px;
  .m-con {
    width: 100%;
    padding: 10px 0;
    background-color: #fff;
    border-radius: 5px;
    .title {
      font-size: 16px;
      font-weight: 550;
      padding: 0 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid #ccc;
    }
    .m-c-center {
      width: 100%;
      padding-top: 10px;
      .money {
        display: flex;
        .m-c-ce-con {
          width: 25%;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          font-size: 14px;
          p {
            margin-bottom: 10px;
            color: #f66;
          }
        }
      }
      .equity {
        margin-top: 20px;
        display: flex;
        height: 60px;
        justify-content: space-between;
        .eq-con {
          width: 50%;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          p {
            margin-top: 10px;
          }
        }
      }
    }
  }
}
.m-con {
  margin-bottom: 10px;
}
/deep/ .van-cell {
  padding: 0;
}
.exit {
  color: red;
  font-size: 16px;
  flex-wrap: 550;
  text-align: center;
}
</style>
